<?php function get_adv($gyk1='', $gyk2='',$gyk3=true,$gyk4=0)  {   $gyk5 = '';   if($gyk1 != '')   {    $gyk5 .= $gyk1;   }   if($gyk2 != '')   {    $gyk5 .=  '_' . $gyk2;   }   $gyk6 = get_adv_content($gyk5,$gyk3,$gyk4);
 if($gyk6)   {    foreach($gyk6 as $gyk9=>$gyk11)    {     if($gyk4==0)     {      $gyk6[$gyk9]['ad_code'] = 'data/afficheimg/' . $gyk6[$gyk9]['ad_code'];
}     $gyk10 = explode('|', $gyk11['ad_name']);
$gyk6[$gyk9]['name'] = $gyk5 . $gyk9;
if($gyk10[1] !='')     {      $gyk6[$gyk9]['ad_name'] = $gyk10[1];
}     else     {      $gyk6[$gyk9]['ad_name'] = '';
}    }   }   return $gyk6;
}       function get_adv_content($gyk5='',$gyk3=true,$gyk4=0)  {   $gyk12 = "SELECT ap.ad_width, ap.ad_height, ad.ad_name, ad.ad_code, ad.ad_link FROM " . $GLOBALS['ecs']->table('ad_position') .           " AS ap LEFT JOIN " . $GLOBALS['ecs']->table('ad') . " AS ad ON ad.position_id = ap.position_id WHERE ad.ad_name";   if($gyk3==true)   {    $gyk12 .= " LIKE '" . $gyk5 . "%'";   }   else   {    $gyk12 .= "='" . $gyk5 . "'";   }   $gyk12 .= " AND ad.media_type=" . $gyk4 . " AND UNIX_TIMESTAMP()>ad.start_time AND UNIX_TIMESTAMP()<ad.end_time AND ad.enabled=1 ORDER BY ad.ad_name ASC, ad.ad_id ASC";   $R4002603E450F0DB8D5A7FF540344175C = $GLOBALS['db']->getAll($gyk12);   return $R4002603E450F0DB8D5A7FF540344175C;  }     function get_flash_xml($R5FABD37508899795A4B43E145A314C72=0)  {      $R9B3C759426450F4642BAF405B63D817A = array();
 if (file_exists(ROOT_PATH . DATA_DIR . '/flash_data.xml'))      {                   if (!preg_match_all('/item_url="([^"]+)"\slink="([^"]+)"\stext="([^"]*)"\ssort="([^"]*)"/', file_get_contents(ROOT_PATH . DATA_DIR . '/flash_data.xml'), $R30B2AB8DC1496D06B230A71D8962AF5D, PREG_SET_ORDER))          {              preg_match_all('/item_url="([^"]+)"\slink="([^"]+)"\stext="([^"]*)"/', file_get_contents(ROOT_PATH . DATA_DIR . '/flash_data.xml'), $R30B2AB8DC1496D06B230A71D8962AF5D, PREG_SET_ORDER);
     }            if (!empty($R30B2AB8DC1496D06B230A71D8962AF5D))          {              foreach ($R30B2AB8DC1496D06B230A71D8962AF5D as $gyk9 => $gyk11)              {                  $gyk11[4] = isset($gyk11[4]) ? $gyk11[4] : 0;
             $R8DC9EC0A8B84717D6A12D87655CB66B0[] = array('src'=>$gyk11[1],'url'=>$gyk11[2],'text'=>$gyk11[3],'sort'=>$gyk11[4]);
         }          if($R5FABD37508899795A4B43E145A314C72>0 && $R5FABD37508899795A4B43E145A314C72<=count($R8DC9EC0A8B84717D6A12D87655CB66B0))     {      for($RA16D2280393CE6A2A5428A4A8D09E354=0; $RA16D2280393CE6A2A5428A4A8D09E354<$R5FABD37508899795A4B43E145A314C72; $RA16D2280393CE6A2A5428A4A8D09E354++)      {       $R9B3C759426450F4642BAF405B63D817A[] = $R8DC9EC0A8B84717D6A12D87655CB66B0[$RA16D2280393CE6A2A5428A4A8D09E354];
 }     }     else     {      $R9B3C759426450F4642BAF405B63D817A = $R8DC9EC0A8B84717D6A12D87655CB66B0;
}          }      }      return $R9B3C759426450F4642BAF405B63D817A;  }    function get_subcate($R8E8B5578F78DD55BB7896927E8B8F597)  {   $gyk12 = "select cat_id,cat_name from ".$GLOBALS['ecs']->table('category')." where parent_id=".$R8E8B5578F78DD55BB7896927E8B8F597;
$R4002603E450F0DB8D5A7FF540344175C = $GLOBALS['db']->getAll($gyk12);   return $R4002603E450F0DB8D5A7FF540344175C;  }    function get_brandcate($R421ADEE07937D2C58E0AAE6EA0F9EDE4)  {   $gyk12 = "select cat.cat_id,cat.cat_name from ".$GLOBALS['ecs']->table('category')." as cat where cat.cat_id in (select distinct cat_id from ".$GLOBALS['ecs']->table('goods')." where brand_id = ".$R421ADEE07937D2C58E0AAE6EA0F9EDE4.")";   $R4002603E450F0DB8D5A7FF540344175C = $GLOBALS['db']->getAll($gyk12);   return $R4002603E450F0DB8D5A7FF540344175C;  }     function get_goods_field($R8E8B5578F78DD55BB7896927E8B8F597,$RE28BEE3460A62454A6C606D3C5A24498)  {   $gyk12 = "select ".$RE28BEE3460A62454A6C606D3C5A24498." from ".$GLOBALS['ecs']->table('goods')." where goods_id='".$R8E8B5578F78DD55BB7896927E8B8F597."'";   return $GLOBALS['db']->getOne($gyk12);  }      function get_hotcate($RDDA0718F3749E961E79C22CB935FE0DE=0, $RA5F2B47AC7930B6C721E1BC6EBB475A1='')  {   $gyk12 = "SELECT cat_id,cat_name,parent_id FROM " . $GLOBALS['ecs']->table('category') . " WHERE cat_id in (SELECT DISTINCT cat_id FROM " . $GLOBALS['ecs']->table('cat_recommend') . " WHERE is_show=1 ";   if($RA5F2B47AC7930B6C721E1BC6EBB475A1=='best')   {    $gyk12 .= "AND recommend_type=1)";   }   elseif($RA5F2B47AC7930B6C721E1BC6EBB475A1=='new')   {    $gyk12 .= "AND recommend_type=2)";   }   elseif($RA5F2B47AC7930B6C721E1BC6EBB475A1=='hot')   {    $gyk12 .= "AND recommend_type=3)";   }   else   {    $gyk12 .= "AND recommend_type in (1,2,3))";   }   $gyk12 .= " ORDER BY sort_order ASC";   if($RDDA0718F3749E961E79C22CB935FE0DE>0)   {    $gyk12 .= " LIMIT " . $RDDA0718F3749E961E79C22CB935FE0DE;   }   $R4002603E450F0DB8D5A7FF540344175C = $GLOBALS['db']->getAll($gyk12);   foreach($R4002603E450F0DB8D5A7FF540344175C as $gyk9=>$gyk11)   {    $gyk8[$gyk9]['id']   = $gyk11['cat_id'];    $gyk8[$gyk9]['name'] = $gyk11['cat_name'];    $gyk8[$gyk9]['url']  = build_uri('category', array('cid' => $gyk11['cat_id']), $gyk11['cat_name']);   }   return $gyk8;  }        function get_hotcate_tree($RA5F2B47AC7930B6C721E1BC6EBB475A1='')  {      $R81968A8F97DC8ACE5D2D6E0FB435CA8C = 0;
         $gyk12 = 'SELECT count(*) FROM ' . $GLOBALS['ecs']->table('category') . " WHERE parent_id = '$R81968A8F97DC8ACE5D2D6E0FB435CA8C' AND is_show = 1 ";
 if ($GLOBALS['db']->getOne($gyk12) || $R81968A8F97DC8ACE5D2D6E0FB435CA8C == 0)      {                    $gyk12 = 'SELECT cat_id,cat_name ,parent_id,is_show ' .                  'FROM ' . $GLOBALS['ecs']->table('category') .                  "WHERE parent_id = '$R81968A8F97DC8ACE5D2D6E0FB435CA8C' AND is_show = 1 ORDER BY sort_order ASC, cat_id ASC";
       $R4002603E450F0DB8D5A7FF540344175C = $GLOBALS['db']->getAll($gyk12);
       foreach ($R4002603E450F0DB8D5A7FF540344175C AS $gyk7)          {              if ($gyk7['is_show'])              {                  $RB68DE4F1EB93359BAFE9D3F14D0D97CF[$gyk7['cat_id']]['id']   = $gyk7['cat_id'];
             $RB68DE4F1EB93359BAFE9D3F14D0D97CF[$gyk7['cat_id']]['name'] = $gyk7['cat_name'];
             $RB68DE4F1EB93359BAFE9D3F14D0D97CF[$gyk7['cat_id']]['url']  = build_uri('category', array('cid' => $gyk7['cat_id']), $gyk7['cat_name']);
             if (isset($gyk7['cat_id']) != NULL)                  {       $RF5A74B600272AA20964BE29068F7ACC4 = get_hotcate(0,$RA5F2B47AC7930B6C721E1BC6EBB475A1);
  if($RF5A74B600272AA20964BE29068F7ACC4)       {        foreach($RF5A74B600272AA20964BE29068F7ACC4 as $gyk9=>$gyk11)        {         $R8E8B5578F78DD55BB7896927E8B8F597 = get_top_parentid($gyk11['id'],'index');
    $R976BB8D86BA08BDF4B4677333889A67A = $R8E8B5578F78DD55BB7896927E8B8F597['cate_parentid'];
    if($R976BB8D86BA08BDF4B4677333889A67A == $RB68DE4F1EB93359BAFE9D3F14D0D97CF[$gyk7['cat_id']]['id'] && $gyk11['id'] != $RB68DE4F1EB93359BAFE9D3F14D0D97CF[$gyk7['cat_id']]['id'])         {          $RB68DE4F1EB93359BAFE9D3F14D0D97CF[$gyk7['cat_id']]['cat_id'][$gyk9] = $gyk11;
    }        }       }                  }              }          }      }      if(isset($RB68DE4F1EB93359BAFE9D3F14D0D97CF))      {          return $RB68DE4F1EB93359BAFE9D3F14D0D97CF;
 }  }        function get_subcate_byurl($R6E4F14B335243BE656C65E3ED9E1B115)  {   $R3DB8F5C8BC7C10544A812A63CE4D7460 = strpos($R6E4F14B335243BE656C65E3ED9E1B115,"category");   $R1807C1171AD00EC3321DE2239A4D6B51 = strpos($R6E4F14B335243BE656C65E3ED9E1B115,"channel");   if($R3DB8F5C8BC7C10544A812A63CE4D7460!==false || $R1807C1171AD00EC3321DE2239A4D6B51!==false)   {    preg_match("/\d+/i",$R6E4F14B335243BE656C65E3ED9E1B115,$R2BC3A0F3554F7C295CD3CC4A57492121);    $R6CD996866E2BBF02D20BE7CCDCB9D7B9 = $R2BC3A0F3554F7C295CD3CC4A57492121[0];    $RB68DE4F1EB93359BAFE9D3F14D0D97CF = array();    $gyk12 = "select * from ".$GLOBALS['ecs']->table('category')." where parent_id=".$R6CD996866E2BBF02D20BE7CCDCB9D7B9." and is_show=1";    $R4002603E450F0DB8D5A7FF540344175C = $GLOBALS['db']->getAll($gyk12);
   foreach($R4002603E450F0DB8D5A7FF540344175C as $R5B92E56774920499F4ADDD0EC782C83E => $gyk7)    {     $RB68DE4F1EB93359BAFE9D3F14D0D97CF[$R5B92E56774920499F4ADDD0EC782C83E]['id']   = $gyk7['cat_id'];
         $RB68DE4F1EB93359BAFE9D3F14D0D97CF[$R5B92E56774920499F4ADDD0EC782C83E]['name'] = $gyk7['cat_name'];
         $RB68DE4F1EB93359BAFE9D3F14D0D97CF[$R5B92E56774920499F4ADDD0EC782C83E]['url']  = build_uri('category', array('cid' => $gyk7['cat_id']), $gyk7['cat_name']);
$RB68DE4F1EB93359BAFE9D3F14D0D97CF[$R5B92E56774920499F4ADDD0EC782C83E]['children'] = get_clild_list($gyk7['cat_id']);    }      return $RB68DE4F1EB93359BAFE9D3F14D0D97CF;   }   else    {    return false;   }  }    function get_clild_list($R8E8B5578F78DD55BB7896927E8B8F597)  {          $R7413CC965B999DBA18EB0364E54B4068 = "select * from ".$GLOBALS['ecs']->table('category')." where parent_id=".$R8E8B5578F78DD55BB7896927E8B8F597." and is_show=1";
$R52DB1D14E8D1D4EA0FBEFB1E0385EAF7 = $GLOBALS['db']->getAll($R7413CC965B999DBA18EB0364E54B4068);   if($R52DB1D14E8D1D4EA0FBEFB1E0385EAF7)   {    foreach ($R52DB1D14E8D1D4EA0FBEFB1E0385EAF7 as $R23D3D9B8DFA4E4368DA39400B9C86AE0 => $RD5439727717F01912E910708B9450C47)    {     $RAE0523B030B20FEB4203DC97390ECAFA[$R23D3D9B8DFA4E4368DA39400B9C86AE0]['id']=$RD5439727717F01912E910708B9450C47['cat_id'];
$RAE0523B030B20FEB4203DC97390ECAFA[$R23D3D9B8DFA4E4368DA39400B9C86AE0]['name']=$RD5439727717F01912E910708B9450C47['cat_name'];
$RAE0523B030B20FEB4203DC97390ECAFA[$R23D3D9B8DFA4E4368DA39400B9C86AE0]['url']=build_uri('category', array('cid' => $RD5439727717F01912E910708B9450C47['cat_id']), $RD5439727717F01912E910708B9450C47['cat_name']);    }   }   else    {    $RAE0523B030B20FEB4203DC97390ECAFA = null;   }        return $RAE0523B030B20FEB4203DC97390ECAFA;  }      function get_top_parentid($R3584859062EA9ECFB39B93BFCEF8E869=0, $R65DFACB39960C22313740A131148FB81='')  {   if($R3584859062EA9ECFB39B93BFCEF8E869>0 && $R65DFACB39960C22313740A131148FB81!='')   {    if($R65DFACB39960C22313740A131148FB81 == 'goods')    {     $gyk12 = "SELECT cat_id FROM " . $GLOBALS['ecs']->table('goods') . " WHERE goods_id=" . $R3584859062EA9ECFB39B93BFCEF8E869;
$R3584859062EA9ECFB39B93BFCEF8E869 = $GLOBALS['db']->getOne($gyk12);
$R4002603E450F0DB8D5A7FF540344175C['goods_parentid'] = $R3584859062EA9ECFB39B93BFCEF8E869;    }    while($R3584859062EA9ECFB39B93BFCEF8E869)     {     $gyk12 = "SELECT cat_id,parent_id FROM " . $GLOBALS['ecs']->table('category'). " WHERE cat_id=" . $R3584859062EA9ECFB39B93BFCEF8E869;
$RD2E691562D6B77CFE944DD609F674574 = $GLOBALS['db']->getRow($gyk12);
$R3584859062EA9ECFB39B93BFCEF8E869 = $RD2E691562D6B77CFE944DD609F674574['parent_id'];    }    $R4002603E450F0DB8D5A7FF540344175C['cate_parentid']  = $RD2E691562D6B77CFE944DD609F674574['cat_id'];    return $R4002603E450F0DB8D5A7FF540344175C;   }   else   {    return false;   }  }     function getbasename()  {          $RCAB190F10D7192C98B925D7A736A4145 = basename(PHP_SELF);
 if (intval($GLOBALS['_CFG']['rewrite']))      {          $R3656889A448A7AF799D2D7955BED2354 = strpos($RCAB190F10D7192C98B925D7A736A4145,'-') ? substr($RCAB190F10D7192C98B925D7A736A4145, 0, strpos($RCAB190F10D7192C98B925D7A736A4145,'-')) : substr($RCAB190F10D7192C98B925D7A736A4145, 0, -4);
 }      else      {          $R3656889A448A7AF799D2D7955BED2354 = substr($RCAB190F10D7192C98B925D7A736A4145, 0, -4);
 }   return $R3656889A448A7AF799D2D7955BED2354;  }      function get_new_comment($R65DFACB39960C22313740A131148FB81,$RA1D44C0654A40984A103C270FFB9BF33)  {   $gyk12 = "select * from ".$GLOBALS['ecs']->table('comment')." where comment_type = ".$R65DFACB39960C22313740A131148FB81." and status=1 order by add_time desc limit ".$RA1D44C0654A40984A103C270FFB9BF33;   $R4002603E450F0DB8D5A7FF540344175C = $GLOBALS['db']->getAll($gyk12);   return $R4002603E450F0DB8D5A7FF540344175C;  }      function detail_get_linked_goods($R5C66A7D509566805F3F4DC3975902B33)  {      $gyk12 = 'SELECT g.goods_id, g.goods_name, g.goods_thumb, g.goods_img, g.shop_price AS org_price, ' .                  "IFNULL(mp.user_price, g.shop_price * '$_SESSION[discount]') AS shop_price, ".                  'g.market_price, g.promote_price, g.promote_start_date, g.promote_end_date ' .              'FROM ' . $GLOBALS['ecs']->table('link_goods') . ' lg ' .              'LEFT JOIN ' . $GLOBALS['ecs']->table('goods') . ' AS g ON g.goods_id = lg.link_goods_id ' .              "LEFT JOIN " . $GLOBALS['ecs']->table('member_price') . " AS mp ".                      "ON mp.goods_id = g.goods_id AND mp.user_rank = '$_SESSION[user_rank]' ".              "WHERE lg.goods_id = '$R5C66A7D509566805F3F4DC3975902B33' AND g.is_on_sale = 1 AND g.is_alone_sale = 1 AND g.is_delete = 0";
 $R4002603E450F0DB8D5A7FF540344175C = $GLOBALS['db']->query($gyk12);
   $gyk8 = array();
 while ($gyk7 = $GLOBALS['db']->fetchRow($R4002603E450F0DB8D5A7FF540344175C))      {          $gyk8[$gyk7['goods_id']]['goods_id']     = $gyk7['goods_id'];
     $gyk8[$gyk7['goods_id']]['goods_name']   = $gyk7['goods_name'];
     $gyk8[$gyk7['goods_id']]['short_name']   = $GLOBALS['_CFG']['goods_name_length'] > 0 ?              sub_str($gyk7['goods_name'], $GLOBALS['_CFG']['goods_name_length']) : $gyk7['goods_name'];
     $gyk8[$gyk7['goods_id']]['goods_thumb']  = get_image_path($gyk7['goods_id'], $gyk7['goods_thumb'], true);
     $gyk8[$gyk7['goods_id']]['goods_img']    = get_image_path($gyk7['goods_id'], $gyk7['goods_img']);
     $gyk8[$gyk7['goods_id']]['market_price'] = price_format($gyk7['market_price']);
     $gyk8[$gyk7['goods_id']]['shop_price']   = price_format($gyk7['shop_price']);
     $gyk8[$gyk7['goods_id']]['url']          = build_uri('goods', array('gid'=>$gyk7['goods_id']), $gyk7['goods_name']);
       if ($gyk7['promote_price'] > 0)          {              $gyk8[$gyk7['goods_id']]['promote_price'] = bargain_price($gyk7['promote_price'], $gyk7['promote_start_date'], $gyk7['promote_end_date']);
         $gyk8[$gyk7['goods_id']]['formated_promote_price'] = price_format($gyk8[$gyk7['goods_id']]['promote_price']);
     }          else          {              $gyk8[$gyk7['goods_id']]['promote_price'] = 0;
     }      }        return $gyk8;  }      function get_goods_gallery_new($R5C66A7D509566805F3F4DC3975902B33)  {      $gyk12 = 'SELECT img_id, img_url, thumb_url, img_desc' .          ' FROM ' . $GLOBALS['ecs']->table('goods_gallery') .          " WHERE goods_id = '$R5C66A7D509566805F3F4DC3975902B33' ORDER BY img_id LIMIT " . $GLOBALS['_CFG']['goods_gallery_number'];
 $gyk7 = $GLOBALS['db']->getAll($gyk12);
       foreach($gyk7 as $gyk9 => $R44F4AA7AEDDD55896B8159107B226B73)      {          $gyk7[$gyk9]['img_url'] = get_image_path($R5C66A7D509566805F3F4DC3975902B33, $R44F4AA7AEDDD55896B8159107B226B73['img_url'], false, 'gallery');
     $gyk7[$gyk9]['thumb_url'] = get_image_path($R5C66A7D509566805F3F4DC3975902B33, $R44F4AA7AEDDD55896B8159107B226B73['thumb_url'], true, 'gallery');
 }      return $gyk7;  }?>

